﻿using System;
using Com.PhilChuang.Utils;

namespace Com.PhilChuang.Pmvp.Ui.Views.Impl.ViewModels
{
	public class SendFeedbackPageViewModel : AbstractViewModel
	{
		public string AppVersionString
		{ get { return AppServiceLocator.Instance.GetImpl<VersionInfo> ().ToStringOr ("N/A"); } }

		#region Bindable Properties
		private String myPrompt;
		public String Prompt
		{
			get { return myPrompt; }
			set
			{
				myPrompt = value;
				RaisePropertyChanged (() => Prompt);
			}
		}

		private String myUserText;
		public String UserText
		{
			get { return myUserText; }
			set
			{
				myUserText = value;
				RaisePropertyChanged (() => UserText);
				RaisePropertyChanged (() => DoSendEmailEnabled);
			}
		}

		public bool DoSendEmailEnabled
		{ get { return AllControlsEnabled && !myUserText.IsNullOrEmptyOrBlank (); } }
		#endregion

		#region Constructors
		//public SendFeedbackPageViewModel ()
		//{
		//}
		#endregion

		protected override void OnAllControlsEnabledChanged ()
		{
			base.OnAllControlsEnabledChanged ();
			RaisePropertyChanged (() => DoSendEmailEnabled);
		}

		#region Functionality (EMPTY)
		#endregion

		#region Utility methods (EMPTY)
		#endregion
	}
}
